package GUI;

import java.beans.XMLEncoder;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;

/**
 * The XML file create instance of this class
 */
public class Encoder 
{
	private String userName;
	private String passwword;
	private String path;
	
	/*get & set methods*/
	
	public String getUserName() 
	{
		return userName;
	}
	public void setUserName(String userName) 
	{
		this.userName = userName;
	}
	public String getPasswword() 
	{
		return passwword;
	}
	public void setPasswword(String passwword) 
	{
		this.passwword = passwword;
	}
	public String getPath()
	{
		return path;
	}
	public void setPath(String path)
	{
		this.path = path;
	}
	
	public void encode(String userName, String password, String path) throws Exception 
	{
		Encoder e = new Encoder();
		e.setUserName(userName);
		e.setPasswword(password);
		e.setPath(path);
	    XMLEncoder en = new XMLEncoder(new BufferedOutputStream(new FileOutputStream("C:/Program Files/m&l_dropbox/details.xml")));
	    en.writeObject(e);
	    en.close();
	}
}
